package com.atguigu.tingshu.user.cdc;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

/**
 * @className: UserHandler
 * @author: xiaoxu
 * @date: 2024/8/31 16:00
 * @Version: 1.0
 * @description:
 */
@Component
@Slf4j
@CanalTable("user_info")
public class UserHandler implements EntryHandler<User> {

    @Override
    public void insert(User user) {
        log.info("insert user:{}", user);
    }

    @Override
    public void update(User before, User after) {
      log.info("update user:{}", after);
    }

    @Override
    public void delete(User user) {
    log.info("delete user:{}", user);
    }
}
